package com.alibaba.citrus.cr.sales.plan.model.enums;

import java.util.Arrays;

/**
 * @author luyi
 * @date 2021/12/01 16:01
 */
public enum NickTypeEnum {

    /**
     * 账号类型
     */
    NORMAL(0,"普通员工"),
    CUSTOMER(1,"外部客户")
    ;

    private final Integer type;

    private final String desc;

    NickTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static NickTypeEnum getByType(Integer type){
        if (type == null){
            return null;
        }
        return Arrays.stream(values()).filter(typeEnum -> typeEnum.getType().equals(type)).findAny().orElse(null);
    }
}
